<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@include file="/WEB-INF/pages/common/common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <%@include file="/WEB-INF/pages/common/head.jsp"%>
    <script type="text/javascript">
    	var ctrlTree;
    	function manageForm(message){
    		var privilege;
    		var isV =$("#tableForm").form("validate");
            if(!isV) return;
        	var items=ctrlTree.combotree("getValues");
        	if(items.length){
            	for(var i=0;i<items.length;i++){
            			privilege += items[i] + ",";
            	}
        	}
        	var data= imonJYRH.serializeObject($("#tableForm *"));
            imonJYRH.showZone();
            $.ajax({
                url : '${path}/sys/role/ajaxModify.do',
                data : data,
                success : function(reMsg) {
                    if(reMsg.success){
                        parent.returnResult();
                        message.show({ msg : reMsg.msg,title : '<spring:message code='msg.tip'/>',showType:'slide'});
                    }else{
                        if(!imonJYRH.isBlank(reMsg.obj)){
                            $.messager.alert('<spring:message code='msg.tip'/>',reMsg['obj']);
                        }else{
                            $.messager.alert('<spring:message code='msg.tip'/>',reMsg['msg']);
                        }
                    }
                    imonJYRH.hideZone();
                }
             });
    	}
    	$(function(){
    		 ctrlTree = $('#authority').combotree({
    			url:'${path}/sys/function/ajaxTreeGrid.do',
       			lines : true,
       			idField :"id",
       			required:true,
				multiple : true,
				checkbox : true,
			    hasDownArrow:true
       		});
    		var values = imonJYRH.getList("${ids}");
    		ctrlTree.combotree('setValues', values);
    	});
    </script>
</head>
<body class="bodyForm">
<table class="tableForm" id="tableForm" width="100%">
    <tr>
        <td align="right"><span style="color:red;">*</span><spring:message code='label.role.code'/>:</td>
        <td align="left">
        	<input type="hidden" name="id" value="${role.id }" >
            <input id="code" type="text" name="code" class="easyui-validatebox" data-options="required:true" value="${role.code }">
        </td>
    </tr>
    <tr>
        <td align="right"><span style="color:red;">*</span><spring:message code='label.role.name'/>:</td>
        <td align="left">
            <input id="name" type="text" name="name" class="easyui-validatebox" data-options="required:true" value="${role.name }"/>
        </td>
    </tr>
    <tr>
        <td align="right"><span style="color:red;">*</span><spring:message code='label.role.name'/>:</td>
        <td align="left">
            <input id="authority" type="text" name="authorityText"  style="width: 145px"  value="${role }"/>
        </td>
    </tr>
    </tr>
		<tr>
			<td align="right"><font color=red>*</font><spring:message code='label.role.remark'/>:</td>
			<td align="left"><textarea id="remark" name="comment" rows="4" cols="30" >${role.comment }</textarea></td>
		</tr>
	</table>
</table>
</body>
</html>